<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>波罗鸡免洗洗手液</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <script src="{{url('js/jquery.min.js')}}"></script>
    <script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <link href="{{url('css/order/style.css')}}" rel="stylesheet" type="text/css"/>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.1.1/css/jquery-weui.min.css">
    <script src="//cdn.bootcss.com/jquery-weui/1.1.1/js/jquery-weui.min.js"></script>
    <style>
        .buy{
            background-color: red;
            color: white;
            width: 150px;
            height: 50px;
            margin-bottom: 100px;
            margin-top: 20px;
        }
    </style>
</head>
<body style="background:#f7f7f7">
    <div style="text-align: center">
        <a href="http://boluoji.rzkeji.com/newGoodsDetail?id=7"><img style="width: 100%;" src="http://file.rzkeji.com/web/boluoji/xiangqing.jpg" alt=""></a>
        <a href="http://boluoji.rzkeji.com/newGoodsDetail?id=7"><button class="buy">立即购买</button></a>
    </div>
<script>
    $(function () {
        wxIni();
        function wxIni(){
            var url=location.href;
            $.ajax({
                type : "post",
                url : "{{route('Api.Wechat.getJsApiPacket')}}",//替换网址，xxx根据自己jssdk文件位置修改
                dataType : "json",
                data:{url:url},
                success : function(obj){
                    if(obj.level == 'success'){
                        var data = obj.data;
                        wx.config({
                            appId: data.appId,
                            timestamp: data.timestamp,
                            nonceStr: data.nonceStr,
                            signature: data.signature,
                            jsApiList: [
                                "updateAppMessageShareData", //分享给好友
                                "updateTimelineShareData", //分享到朋友圈
                                "chooseWXPay","openAddress"
                            ]
                        });

                        wx.ready(function () {   //需在用户可能点击分享按钮前就先调用
                            wx.updateAppMessageShareData({
                                title: '菠萝鸡免洗抑菌洗手液，数量有限，现开放购买', // 分享标题
                                desc: '含中药成分，二天堂制药合作产品', // 分享描述
                                link: "{{route('Home.Page.newGoodsDetail')}}?id=7", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                                imgUrl: 'http://file.rzkeji.com/web/boluoji/1.jpg', // 分享图标
                                success: function () {
                                    // 设置成功
                                }
                            })

                            wx.updateTimelineShareData({
                                title: '菠萝鸡免洗抑菌洗手液，数量有限，现开放购买', // 分享标题
                                link: "{{route('Home.Page.newGoodsDetail')}}?id=7", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                                imgUrl: 'http://file.rzkeji.com/web/boluoji/1.jpg', // 分享图标
                                success: function () {
                                    // 设置成功
                                }
                            })
                        });
                    }
                },
                error:function(data){
                    console.log("连接失败！");
                }
            });
        }

    })
</script>
</body>
</html>